#ifndef _MENU_
#define _MENU_


#include <stdlib.h>
#include <string.h>
#include <stdio.h>

typedef enum boolean{false = 0, true} bool;

typedef struct menu_data* menu;

typedef struct menu_node* Nodeptr;

menu create(void);
/*this fuction creates the menu*/
/*in case of failure returns NULL*/

void destroy(menu target_menu);
/*this fuction deletes the menu*/

bool empty(menu target_menu);
/*this fuction returns true if the menu is empty*/

bool insert_node(menu target_menu, char* data);
/*this fuction inserts a node after the cursor, in the same level, and puts the name in*/
/*in case of failure returns false*/

bool insert_subnode(menu target_menu, char* data);
/*this fuction inserts a node in the lower level of the cursor, and puts the name in*/
/*in case of failure returns false*/

void delete_node(menu target_menu);
/*this fuction deletes the node the curson shows and all it's subnodes*/

void delete_sublevel(Nodeptr node, unsigned int size);


void next(menu target_menu);
/*this fuction moves the curson right*/

void previous(menu target_menu);
/*this fuction moves the cursor left*/

void up(menu target_menu);
/*this fuction moves the cursor up*/

void down(menu target_menu);
/*this fuction movew the cursor down*/

void print_menu(menu target_menu);

void print_level(menu target_menu);
/*this fuction prints the target's menu cursor's level*/

void print_sublevel(menu target_menu);
/*this fuction prints all the nodes of the subnodes*/

void print(menu target_menu);
/*this fuction prints the node string*/

bool change(menu target_menu, char* name);
/*this fuction changes the data of the cursor shwing node*/

void change_nodes(menu target_menu);
/*this fuction changes the node the cursor shows with it's next*/

#endif
